﻿@model System.Collections.IDictionary
@using Kooboo.Web.Script.Serialization
@{
    Layout = ViewBag.Layout ?? "..\\EditorTemplates\\_TR.cshtml";

    var fullPropertyName = ViewData.TemplateInfo.HtmlFieldPrefix;
    if (ViewBag.FullPropertyName != null)
    {
        fullPropertyName = ViewBag.FullPropertyName.ToString();
    }
    var elementId = fullPropertyName.Replace(".", "_");
    var propertyName = ViewData["name"] == null ? ViewData.ModelMetadata.PropertyName : ViewData["name"].ToString();
    var koTemplateId = elementId + "_Editor";
}

<table class="key-value">
    <thead>
        <tr>
            <th>@("Key".Localize())
            </th>
            <th>@("Value".Localize())
            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var key in Model.Keys)
        {
            <tr>
                <td>
                    <label>@key</label>
                </td>
                <td>
                    <label>@Model[key]</label>
                </td>
            </tr>
        }

    </tbody>
</table>
@if (!string.IsNullOrEmpty(ViewData.ModelMetadata.Description))
{
    <em class="tip">@Html.Raw(ViewData.ModelMetadata.Description.Localize())</em>
}